/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package dao;

import java.util.List;
import javax.persistence.EntityManager;
import model.Escola;

/**
 *
 * @author ronaldomartins
 */
public class DaoEscola extends Dao{

    @Override
    public List listarTodos() {
        List objs = null;
        EntityManager em = getEntityManager();
        objs = em.createQuery("select e from Escola e").getResultList();
        return objs;
    }

    @Override
    public Object buscarPorId(Long id) {
        Object obj = null;
        EntityManager em = getEntityManager();
        obj = em.find(Escola.class, id);
        return obj;
    }    
}
